package com.secsbrain.engine.client.iface;

import java.util.List;

import com.secsbrain.common.ResponseVo;
import com.secsbrain.engine.client.model.HistoryTask;
import com.secsbrain.engine.client.model.TaskDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 任务相关服务
 *
 * @author zhaoyi
 */
@FeignClient(value = "service-engine-${engine.env:dev}")
public interface TaskInfoService {
	
	/**
     * 功能描述: <br>
     * 查询用户要处理的任务
     *
     * @param userId   用户ID
     * @param roleCode 角色编号
     * @param processDefinitionKeys 流程定义key数组
     * @return
     */
    @RequestMapping(value = "/task/queryTodo", method = RequestMethod.GET)
    ResponseVo<List<TaskDto>> queryTodo(@RequestParam("userId") String userId, @RequestParam("roleCode") String roleCode, @RequestParam("processDefinitionKeys") String... processDefinitionKeys);
    
    /**
     * 功能描述: <br>
     * 查询打回的任务
     *
     * @param userId   用户ID
     * @param processDefinitionKeys 流程定义key数组
     * @return
     */
    @RequestMapping(value = "/task/queryRefused", method = RequestMethod.GET)
	ResponseVo<List<TaskDto>> queryRefused(@RequestParam("userId") String userId,@RequestParam("processDefinitionKeys") String... processDefinitionKeys);
    
    /**
     * 功能描述: <br>
     * 通过流程实例ID查询当前任务
     *
     * @param processInstanceId  流程实例ID
     * @return
     */
	@RequestMapping(value = "/task/queryByProcessInstanceId", method = RequestMethod.GET)
	ResponseVo<TaskDto> queryByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId);
    
    /**
     * 功能描述: <br>
     * 通过实例ID查询流程历史
     *
     * @param processInstanceId  流程实例ID
     * @return
     */
    @RequestMapping(value = "/task/historyByInstanceId", method = RequestMethod.GET)
	ResponseVo<List<HistoryTask>> historyByInstanceId(@RequestParam("processInstanceId") String processInstanceId);
	
}
